package com.srit.system.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.srit.system.bean.CodeType;
import com.srit.system.dao.CodeTypeDao;

/**
 * 拖拽模块 controller
 * 
 * @author guan
 * 
 */
@Controller
public class DragController {
	@Autowired
	private CodeTypeDao codeTypeDao;

	@RequestMapping(value = "/drag-view")
	public String view(ModelMap modelMap) {
		List<CodeType> codeTypeList = codeTypeDao.listOnDrag();
		modelMap.addAttribute("codeTypeList", codeTypeList);
		return "system/drag";
	}

	@RequestMapping("/drag.json")
	public @ResponseBody
	List<CodeType> list() {
		return codeTypeDao.listOnDrag();
	}

}
